package com.lizheng.yunservice.travel.controller;

import com.lizheng.yunservice.common.domain.ApiRestResponse;
import com.lizheng.yunservice.travel.doamin.vo.VtpAppExploreCategoryVo;
import com.lizheng.yunservice.travel.doamin.vo.VtpAppExploreVo;
import com.lizheng.yunservice.travel.service.VtpExploreService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/vtp/app/explore")
public class VtpAppExploreController {

    @Qualifier("vtpExploreServiceImpl")
    private final VtpExploreService exploreService;
    /**
     * 获取探索分类列表
     */

    @GetMapping("/getCategory")
    public ApiRestResponse<List<VtpAppExploreCategoryVo>> getExplorer()
    {
        return ApiRestResponse.ok(exploreService.getExplore());
    }
    /**
     * 获取探索发现列表
     */
    @GetMapping("/getExploreList/{id}")
    public ApiRestResponse<List<VtpAppExploreVo>> getExplorerBYCategoryId(@PathVariable Long id){
        List<VtpAppExploreVo> list = exploreService.getExploreBYCategoryId(id);
        return ApiRestResponse.ok(list);
    }
    /**
     * 获取探索发现详细信息
     */
    @GetMapping("/getExplore/{id}")
    public ApiRestResponse<VtpAppExploreVo> getExplorerBYId(@PathVariable Long id){

        return ApiRestResponse.ok(exploreService.getExploreBYExpolreId(id));
    }

}